--[[

        resource.lua
        exported by excel2lua.py
        from file:resource.xlsx

--]]

local _data = {
  [1] = {id = 1,name = '银币',res = 'res1',},
  [2] = {id = 2,name = '灵石',res = 'res2',},
}

local id_to_index={
   [1] = 1,
   [2] = 2,
}

local resource={}

function resource.length() 
   return #_data 
end 

function resource.indexOf(index) 
   return _data[index] 
end 

function resource.get(id) 
  return resource.indexOf(id_to_index[id])
end 

return resource